package com.example.librarysystem.mapper;

import com.example.librarysystem.model.BookInfo;
import com.example.librarysystem.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.awt.print.Book;
import java.util.List;

@Mapper
public interface UserInfoMapper {
    @Select("select * from user_info where user_name=#{username}")
    UserInfo queryUserByUsername(String username);

    @Select("select * from book_info where `status`!=0 limit #{offset} #{pagesize}")
    List<Book> selectBookBypage(Integer offset, Integer pagesize);

    Integer updateBook(BookInfo bookinfo);
    Integer batchDelete(List<Integer> ids);
    @Insert("insert into book_info (user_name,password,delete_flag) values (#{username}," +
            "#{password},#{deleteFlag})")
    Integer adduserinfo(UserInfo userInfo);
}
